import request from '../utils/request'

const area = '/AppAPI_Order'

export const create = (data) => {
  return request({
    url: `${area}/Create`,
    method: 'post',
    data
  })
}
export const list = (params) => {
  return request({
    url: `${area}/List`,
    method: 'get',
    params
  })
}
export const detail = (params) => {
  return request({
    url: `${area}/Detail`,
    method: 'get',
    params
  })
}
export const storeInfo = (params) => {
  return request({
    url: `${area}/StoreInfo`,
    method: 'get',
    params
  })
}
export const count = (params) => {
  return request({
    url: `${area}/Count`,
    method: 'get',
    params
  })
}
// 订单提交前的各部分金额（配送费，满减...）
export const getPrePrice = (data) => {
  return request({
    url: `${area}/PreCreate_Price`,
    method: 'post',
    data
  })
}
// 获取可用红包列表
export const getCanUseCoupon = (data) => {
  return request({
    url: `${area}/CanUseCoupon`,
    method: 'post',
    data
  })
}

// 取消订单
export const cancel = (data) => {
  return request({
    url: `${area}/Cancel`,
    method: 'post',
    data
  })
}

